const express = require('express');
const router = express.Router()
const TagsController = require('../controllers/tagsController');
const { body } = require('express-validator');
router.post('/list', TagsController.tagsList)
router.post('/add',[
  body('name').notEmpty().withMessage('标签名称(name)不能为空'),
  body('category_id').notEmpty().withMessage('分类ID(category_id)不能为空'),
  body('stats').notEmpty().withMessage('启禁状态(stats)不能为空'),
], TagsController.tagsAdd)
router.post('/upd', [
  body('name').notEmpty().withMessage('标签名称(name)不能为空'),
  body('category_id').notEmpty().withMessage('分类ID(category_id)不能为空'),
  body('stats').notEmpty().withMessage('启禁状态(stats)不能为空'),
], TagsController.tagsUpd)
router.get('/detail', TagsController.tagsDetail)
// router.delete('/del', TagsController.domianDele)
module.exports = router

